import { createApp } from 'vue'
import App from './App.vue'
import { router } from './router/index'
import element from 'element-plus'
import 'element-plus/theme-chalk/index.css';
// import axios from "axios"
// axios.interceptors.request.use(config=>{
//     let token = localStorage.getItem("token")
//     if(token){
//         config.headers.Authorization=token
//     }
//     return config
// },error=>{
//     router.push("/login")
//     return Promise.reject(error)
// })

// router.beforeEach((to, from, next) => {
//     let white = ["/login"]
//     let pathlist = JSON.parse(localStorage.getItem("vurl"))
//     if(pathlist){
//         for(var i=0;i<=pathlist.length;i++){
//             white.push(pathlist[i])
//         }
//         if(white.includes(to.path)){
//             next()
//         }else{
//             alert("您没有权限")
//         }
//     }else {
//         if (white.includes(to.path)) {
//             next()
//         } else {
//             alert("您没有权限")
//         }
//     }
// })



const app = createApp(App)


import Vant from 'vant';
import 'vant/lib/index.css';

app.use(Vant);

app.use(router);

app.mount('#app')
app.use(element)